package cn.wolfcode.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.List;

@Getter
@Setter
public class Menu {
    /** */
    private Long id;

    /** 菜单名称*/
    private String name;

    /*class*/
    private String className;

    /** URL地址*/
    private String url;

    /** 菜单图标*/
    private String icon;

    /** 菜单状态*/
    private int state;

    /** 菜单类型*/
    private int type;

    /** 菜单序号*/
    private int number;

    /** 创建时间*/
    private Date creatTime;

    //父id
    private Long pId ;
    //父name
    private String pName ;
    //权限表达式
    private String expression;

    private List<Menu> subMenu ;

    public String getStateDisplay(){
        if (this.state==0){
            return "禁用";
        }else{
            return "启用";
        }
    }

    public String getTypeDisplay(){
        if (this.type==0){
            return "目录";
        }else if(this.type==1){
            return "菜单";
        }
        return "未知";
    }
}